package com.skplanet.rade.security;

import javax.annotation.Resource;

import org.springframework.dao.DataAccessException;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.transaction.annotation.Transactional;

@Transactional
public class UserDetailsServiceImpl implements UserDetailsService {
	
	@Resource( name = "securityUserService" )
	private SecurityUserService securityUserService;
	
	@Override
	public UserDetails loadUserByUsername(String username)	throws UsernameNotFoundException, DataAccessException {
		AbstractSecurityUser securityUser =  securityUserService.loadUserByUsername( username );
		return securityUser;
	}
}